package agentspeakeditor.editors.common.scanner;


public class Token extends org.eclipse.jface.text.rules.Token {

	// The token kind
	private TokenType kind;
	// The token spelling
	private String spelling;
	// The line and column that the token was found
	private int line, column;
	private int length, offset;
	
	
	
	
	/**
	 * Default constructor
	 * @param kind
	 * @param spelling
	 * @param line
	 * @param column
	 */
	public Token(TokenType kind, String spelling, int line, int column, Object data) {
		super(data);
		this.kind = kind;
		this.spelling = spelling;
		this.line = line;
		this.column = column;
	}

	/**
	 * Returns token kind
	 * @return
	 */
	public TokenType getKind() {
		return kind;
	}

	/**
	 * Returns token spelling
	 * @return
	 */
	public String getSpelling() {
		return spelling;
	}

	/**
	 * Returns the line where the token was found
	 * @return
	 */
	public int getLine() {
		return line;
	}

	/**
	 * Returns the column where the token was found
	 * @return
	 */	
	public int getColumn() {
		return column;
	}
	
	/*
	 * @see IToken#isEOF()
	 */
	public boolean isEOF() {
		return (this.kind == TokenType.EOT);
	}

	public int getLength() {
		return length;
	}

	public void setLength(int length) {
		this.length = length;
	}

	public int getOffset() {
		return offset;
	}

	public void setOffset(int offset) {
		this.offset = offset;
	}
	
	
}